<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<form id="form_user_showedit" method="post" action="../../shiro/user/save.action">
    <input type="hidden" name="userId" value="${sysUser.userId==null?0:sysUser.userId}">
    <table class="tab_form">
        <tr>
            <td><input class="easyui-textbox" name="username" data-options="label:'用户名称:',required:true"
                       value="${sysUser.username}"/></td>
            <td><input class="easyui-textbox" name="loginpass" data-options="label:'用户密码:',required:true"
                       value="123456"/></td>
            <td>
                <input class="easyui-combobox" name="roleIds"
                       data-options="label:'选择角色:',valueField:'id',textField:'text',url:'../../shiro/role/loadComboBoxData.action?userId=${sysUser.userId}',multiple:true,required:true" />
            </td>
        </tr>
        <tr>
				 	<td >类&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
					<td ><input type="radio"   name="userType" class="easyui-validatebox" data-options="required:true"
                       value="1"/>学生</td>
                       
					<td><input type="radio"  class="easyui-validatebox"  name="userType" data-options="required:true"
                       value="2"/>辅导员</td>    	
        </tr>
          <tr>
          			<td >请选择对应班级:</td>
         		 <td><input class="easyui-combobox" name="classId"
                       data-options="label:'选择班级:',valueField:'id',textField:'text',url:'../../shiro/class/loadComboBoxData.action',multiple:true,required:true" /></td>>
         </tr>
    </table>
</form>
<div style="text-align:center;padding:5px 0">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
</div>
<script>
$.extend($.fn.validatebox.defaults.rules, {
    requireRadio: {  
        validator: function(value, param){  
        	alert(param);
        	alert(value);
            var input = $(param[0]);
            input.off('.requireRadio').on('click.requireRadio',function(){
                $(this).focus();
            });
            return $(param[0] + ':checked').val() != undefined;
        },  
        message: '请选择类型{1}.'  
    }  
});
    function submitForm() {
        $('#form_user_showedit').form('submit', {
            success: function () {
                $('#win_main').window("close");
                $("#user_list").datagrid("reload");
            }
        });
    }
    function clearForm() {
        $('#form_user_showedit').form('clear');
    }
</script>